#ifndef ABSTRACTSTRUCT_H
#define ABSTRACTSTRUCT_H

#include <QVariant>

#include "freyacommon_global.h"
#include "freyaabstractstruct.h"

class FRYCOMMON_EXPORT AbstractStruct : public FreyaAbstractStruct
{
public:
    enum StructType
    {
        UnKnowType = 0,
        DataOperate,
        SystemLog,
        ComMessage
    };

public:
    explicit AbstractStruct(StructType type);
    virtual ~AbstractStruct();

    AbstractStruct::StructType Type();
    static AbstractStruct::StructType Type(const QVariant &variant);

    QVariant ToVariant();
    bool FromVariant(const QVariant &variant);

protected:

    virtual QVariant ToTemplate(QVariantMap &varMap) = 0;
    virtual void FromTemplate(const QVariant &variant) = 0;

private:
    StructType   m_emType;
};

#endif // ABSTRACTSTRUCT_H
